{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn import datasets, linear_model\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv('D:\\data.csv')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Age</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>High Blood Pressure</th>\n",
       "      <th>Low Blood Pressure</th>\n",
       "      <th>Cholesterol</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>Smoke</th>\n",
       "      <th>Alcohol</th>\n",
       "      <th>Exercise</th>\n",
       "      <th>Disease</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>59</td>\n",
       "      <td>female</td>\n",
       "      <td>167</td>\n",
       "      <td>88.0</td>\n",
       "      <td>130</td>\n",
       "      <td>68</td>\n",
       "      <td>normal</td>\n",
       "      <td>normal</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>64</td>\n",
       "      <td>female</td>\n",
       "      <td>150</td>\n",
       "      <td>71.0</td>\n",
       "      <td>140</td>\n",
       "      <td>100</td>\n",
       "      <td>normal</td>\n",
       "      <td>normal</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>41</td>\n",
       "      <td>female</td>\n",
       "      <td>166</td>\n",
       "      <td>83.0</td>\n",
       "      <td>100</td>\n",
       "      <td>70</td>\n",
       "      <td>normal</td>\n",
       "      <td>normal</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>50</td>\n",
       "      <td>male</td>\n",
       "      <td>172</td>\n",
       "      <td>110.0</td>\n",
       "      <td>130</td>\n",
       "      <td>80</td>\n",
       "      <td>normal</td>\n",
       "      <td>normal</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>39</td>\n",
       "      <td>female</td>\n",
       "      <td>162</td>\n",
       "      <td>61.0</td>\n",
       "      <td>110</td>\n",
       "      <td>80</td>\n",
       "      <td>high</td>\n",
       "      <td>high</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Age  Gender  Height  Weight  High Blood Pressure  Low Blood Pressure  \\\n",
       "0   59  female     167    88.0                  130                  68   \n",
       "1   64  female     150    71.0                  140                 100   \n",
       "2   41  female     166    83.0                  100                  70   \n",
       "3   50    male     172   110.0                  130                  80   \n",
       "4   39  female     162    61.0                  110                  80   \n",
       "\n",
       "  Cholesterol Glucose  Smoke  Alcohol  Exercise  Disease  \n",
       "0      normal  normal      0        0         1        0  \n",
       "1      normal  normal      0        0         0        1  \n",
       "2      normal  normal      0        1         1        0  \n",
       "3      normal  normal      1        0         1        0  \n",
       "4        high    high      0        0         1        0  "
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 12)"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Age</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>High Blood Pressure</th>\n",
       "      <th>Low Blood Pressure</th>\n",
       "      <th>Smoke</th>\n",
       "      <th>Alcohol</th>\n",
       "      <th>Exercise</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>59</td>\n",
       "      <td>167</td>\n",
       "      <td>88.0</td>\n",
       "      <td>130</td>\n",
       "      <td>68</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>64</td>\n",
       "      <td>150</td>\n",
       "      <td>71.0</td>\n",
       "      <td>140</td>\n",
       "      <td>100</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>41</td>\n",
       "      <td>166</td>\n",
       "      <td>83.0</td>\n",
       "      <td>100</td>\n",
       "      <td>70</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>50</td>\n",
       "      <td>172</td>\n",
       "      <td>110.0</td>\n",
       "      <td>130</td>\n",
       "      <td>80</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>39</td>\n",
       "      <td>162</td>\n",
       "      <td>61.0</td>\n",
       "      <td>110</td>\n",
       "      <td>80</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Age  Height  Weight  High Blood Pressure  Low Blood Pressure  Smoke  \\\n",
       "0   59     167    88.0                  130                  68      0   \n",
       "1   64     150    71.0                  140                 100      0   \n",
       "2   41     166    83.0                  100                  70      0   \n",
       "3   50     172   110.0                  130                  80      1   \n",
       "4   39     162    61.0                  110                  80      0   \n",
       "\n",
       "   Alcohol  Exercise  \n",
       "0        0         1  \n",
       "1        0         0  \n",
       "2        1         1  \n",
       "3        0         1  \n",
       "4        0         1  "
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = data[['Age','Height', 'Weight','High Blood Pressure','Low Blood Pressure','Smoke','Alcohol','Exercise']]\n",
    "X.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Disease</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Disease\n",
       "0        0\n",
       "1        1\n",
       "2        0\n",
       "3        0\n",
       "4        0"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = data[['Disease']]\n",
    "y.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.cross_validation import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.cross_validation import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(750, 8)\n",
      "(750, 1)\n",
      "(250, 8)\n",
      "(250, 1)\n"
     ]
    }
   ],
   "source": [
    "print (X_train.shape)\n",
    "print (y_train.shape)\n",
    "print (X_test.shape)\n",
    "print (y_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "linreg = LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linreg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.73794544]\n",
      "[[ 0.01172437 -0.00090005  0.00735547  0.00156789  0.00040773 -0.03458377\n",
      "   0.01149551 -0.06670356]]\n"
     ]
    }
   ],
   "source": [
    "print (linreg.intercept_)\n",
    "print (linreg.coef_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "#模型拟合测试集\n",
    "y_pred = linreg.predict(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE:\n",
      "RMSE:\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(None, 0.4742173750270571)"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print (\"MSE:\"),metrics.mean_squared_error(y_test, y_pred)\n",
    "print (\"RMSE:\"),np.sqrt(metrics.mean_squared_error(y_test, y_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE:\n",
      "RMSE:\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(None, 0.4742173750270571)"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = data[['High Blood Pressure','Low Blood Pressure','Smoke','Alcohol']]\n",
    "y = data[['Disease']]\n",
    "from sklearn.model_selection import cross_val_predict\n",
    "predicted = cross_val_predict(linreg, X, y, cv=10)\n",
    "print (\"MSE:\"),metrics.mean_squared_error(y_test, y_pred)\n",
    "print (\"RMSE:\"),np.sqrt(metrics.mean_squared_error(y_test, y_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAGh1JREFUeJzt3X+cVfV95/HXmwFkZgRkdajiL36obF20Kxl/1PzQqDRqo5g0j0SydjUxpf4Mm1oTfSQxtjabGNy0dmtMqSJGIkYTS222ijSJRXf9NYqKomyVogFtGNcgCAMM8Nk/7hlzGe7MnLlzz7nMnPfz8ZgH555z5nw/R/D7vud7fikiMDOz4hpW7wLMzKy+HARmZgXnIDAzKzgHgZlZwTkIzMwKzkFgZlZwDgIzs4JzEJiZFZyDwMys4IbXu4A0DjjggJg4cWK9yzAzG1SeeeaZtyOipa/1BkUQTJw4kba2tnqXYWY2qEh6Pc16HhoyMys4B4GZWcE5CMzMCi6zIJA0X9J6SS92m3+lpFWSXpL0nazaNzOz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CE0lUI8yPiJUl/DrRFxAPA7ZQOKV+ldCRwfv0qrl7KfZ0L7Avcl5wPfyMizq1b0QOQcn+HjJT7uwT4PUkrgZ3A1RHx/+pXdfVS7u9VwN9J+hKlYZKLBumXOCQtojSkd0ByzuMbwAiAiPg+pXMgZwOvAluAz2VWyyD9b2hmZjUyFIeGzMysHxwEZmYF5yAwMys4B4GZWcE5CMzMCs5BYENe8hTSu8o+D5fULmmvfgyFpEcG8c1wNog4CKwINgPTJDUmn2cA6+pRSHInu9lexUFgRfEg8PvJ9CxgUdcCSc3Js+GfTp5zPzOZP1HSo5KeTX5OTuYfJGmZpOckvSjpw8n898q2+SlJC5LpBZK+K+kXwI29tNco6Z7k2fM/ArqCyyxT/nZiRXEPcF0yHHQsMB/4cLLsq5QeM/J5SfsBT0n6Z2A9MCMitko6klJ4tAKfBZZExDclNQBNKdo/CjgjInZK+u89tPfHwJaIOFbSscCzNdt7s144CKwQIuIFld5EN4vSrfvlfg84V9KfJp9HAYdResDX30j6z5Qe33BUsvxpYL6kEcDiiHguRQn3RcTOPtr7CPDXZfW+0L+9NKuOg8CK5AHgJkrPdyl//4SAP4iIVeUrS7oe+BXwO5SGUbdC6YUikj5CaajpLklzI+IH7P6I4FHd2t6coj0YnI9Dt0HO5wisSOYDfx4RK7rNXwJc2fWWuuSJrVB6PPlbybPu/5DSg9BQ6b3P6yPi7yg9wLDrXbK/kvTbyXsRPtFLHT21twz4L8m8aZSGsMwy5yCwwoiItRFxc4VFN1B66uMLKr1I/IZk/veACyU9QWlYqOtb/anAc5KWA38AdG3zGuCnwM+B3h4X3FN7twL7JkNCXwae6vdOmlXBTx81Mys4HxGYmRWcg8DMrOAcBGZmBecgMDMrOAeBmVnBOQjMzArOQWBmVnAOAjOzgvv/EaaXmnIOj80AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "ax.scatter(y, predicted)\n",
    "ax.plot([y.min(), y.max()], [y.min(), y.max()], 'k--', lw=4)\n",
    "ax.set_xlabel('Measured')\n",
    "ax.set_ylabel('Predicted')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
